import Cookies from 'js-cookie';
import { redirectLoginPage } from '../service/auth';

const Authentication = ({ children }) => {
  if (!Cookies.get('token')) {
    redirectLoginPage();
    return null;
  }
  return children;
};

export default Authentication;
